const PORT = process.env.PORT || 9999;
const NODE_ENV = process.env.NODE_ENV || 'development';
const IS_DEV = NODE_ENV === 'development'

module.exports.APP_PORT = PORT
module.exports.DEBUG = NODE_ENV === 'development';

const dbConnections = {
  development: 'mongodb://127.0.0.1:27017/wow-portal',
  // production: 'mongodb://wow:wow2024@127.0.0.1:27017/wow',
};
module.exports.DB_CONNECTION = dbConnections[NODE_ENV];

/** Cookie 配置 */
module.exports.COOKIE = {
  domain: IS_DEV ? 'localhost' : '*.wow-portal.com'
}

/** jwt 配置 */
module.exports.JWT = {
  name: 'name_2024',
  secret: 'secret_2024',
}

/** 路由白名单 */
module.exports.ROUTE_WHITE_LIST = [
  '/',
  /^\/public/,
]

/** admin 临时 username */
module.exports.ADMIN_KEY = Math.random().toString(36).substring(2)

/** 微信 API */
module.exports.WEIXIN = {
  token: 'wow2024',
  originId: 'gh_ce9a5f6bff50',
  appid: 'wxf24bd18e109c964c',
  secret: '4c7227b329f6c2ad9d23ba217e70069d',
}

/** 战网 API */
module.exports.BATTLE_NET = {
  clientId: '5e6cb28c304f4c06b8074f9cf5fbe2cd',
  clientSecret: 'xyW27c9W44nr29eZ2wuy48afs7YDQdqo',
}

module.exports.Language = 'zh_CN'
